package com.liyiruo.testMain;

import com.liyiruo.pojo.HelloWorld;
import com.liyiruo.service.UserService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import java.util.Map;

/**
 * 这个类用来测试循环依赖，刷源码用的
 * ClassPathXmlApplicationContext 下的 refresh()方法开始
 * link<>https://www.bilibili.com/video/BV1rt4y1u7q5?p=54&vd_source=242f205794a98f6f5e47f078b213400c</>
 */
public class CyclicDependecyTest {
    public static void main(String[] args) {
        /**
         * 从classpath目录下获取xml文件
         */
        ApplicationContext context = new ClassPathXmlApplicationContext("cyclicDependency.xml");
        Object beanA = context.getBean("cyclicA");
        Object beanB = context.getBean("cyclicB");



    }
}
